package org.example.myleet.p521;

public class Solution {
    public int findLUSlength(String a, String b) {
        if (a.length() != b.length()) {
            return Math.max(a.length(), b.length());
        }
        int i = 0, n = a.length();
        while (i < n) {
            if (a.charAt(i) != b.charAt(i)) {
                return n - i;
            }
            ++i;
        }
        return -1;
    }
}
